<template>
  <div class="app-container-10 container-f0f2f5 app-main system-tenant-container">
    <div class=" container-fff app-container-15 app-ele-border-radius-0">
      <!--租户列表-->
      <div class="sys-content-tenant">
        <!--操作-->
        <div class="sys-btn-box">
          <el-button size="small" type="primary" icon="el-icon-plus" @click="addNewTenant">新增</el-button>
          <!-- 多选后删除-->
          <el-button size="small" type="danger" icon="el-icon-delete" :disabled="!delTenantList.length" @click="isCan">
            删除
          </el-button>
        </div>
        <evue-table :data="tenantData" :option="tenantOption" @selectionChange="selectionChange"
                    @handleEdit="handleEdit" @handleDelete="handleDelete">
          <template v-slot:tenantStatus="props">
            <el-switch
                v-model="props.data.status"
                :active-value="1"
                :inactive-value="0"
            >
            </el-switch>
          </template>
        </evue-table>
      </div>
    </div>
    <!--新增租户-->
    <el-dialog
        custom-class="up-dialog"
        :close-on-click-modal="false"
        top="5vh"
        :title="addTenantFormData.id ? '编辑租户':'添加租户'"
        :visible.sync="dialogAddTenant"
        width="800px"
    >
      <div class="dialog-content add-user-pop app-ele-border-radius-0">
        <evue-form ref="eVueForm" @submit="handleAddNewTenant" v-model="addTenantFormData" :option="addTenantOption">
          <template v-slot:tenantStatus="props">
            <el-switch
                v-model="props.data.status"
                :active-value="1"
                :inactive-value="0"
            >
            </el-switch>
          </template>
        </evue-form>
      </div>
      <div slot="footer" style="text-align: left">
        <el-button size="small" type="primary" @click="$refs.eVueForm.submit()">确定</el-button>
        <el-button size="small" @click="handleDialogAddUserClose">取消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import Index from './index'

export default Index
</script>
<style lang="scss" scoped>
@import "index";
</style>
